import 'package:flutter/material.dart';
import 'package:qaun_ni_dev/home_page.dart';
import 'package:qaun_ni_dev/pages/active/active_page.dart';
import 'package:qaun_ni_dev/pages/adminManage/admin_page.dart';
import 'package:qaun_ni_dev/pages/appUser/app_user_page.dart';
import 'package:qaun_ni_dev/pages/attribute/attribute_page.dart';
import 'package:qaun_ni_dev/pages/auditModule/auditModule.dart';
import 'package:qaun_ni_dev/pages/brushsHappy/brush_happy_page.dart';
import 'package:qaun_ni_dev/pages/customService/customService.dart';
import 'package:qaun_ni_dev/pages/gift/gift_page.dart';
import 'package:qaun_ni_dev/pages/headPortrait/header_portrait_page.dart';
import 'package:qaun_ni_dev/pages/login.dart';
import 'package:qaun_ni_dev/pages/person/person.dart';
import 'package:qaun_ni_dev/pages/realNameCheck/real_name_check.dart';
import 'package:qaun_ni_dev/pages/report/report_page.dart';
import 'package:qaun_ni_dev/pages/temp_reserve/other.dart';
import 'package:qaun_ni_dev/pages/testPage/upload__img.dart';
import 'im/pages/conversation_page.dart';
import 'im/pages/image_preview_page.dart';
import 'im/pages/sight/video_play_page.dart';
import 'im/pages/sight/video_record_page.dart';

import 'other/debug_page.dart';

final routes = {
  '/homePage': (context) => HomePage(),
  '/conversation': (context, {arguments}) => ConversationPage(arguments: arguments),
  '/image_preview':(context, {arguments}) => ImagePreviewPage(message: arguments),
  '/debug':(context) => DebugPage(),
  '/video_record':(context, {arguments}) => VideoRecordPage(arguments: arguments),
  '/video_play':(context, {arguments}) => VideoPlayPage(message: arguments),
  '/aduitModule': (context) => AuditModule(),
  '/customModule': (context) => CustomService(),
  '/otherPage': (context) => OtherPage(),
  '/person': (context) => Person(),
  '/login': (content) => Login(),
  '/AdminPagess': (context) => AdminPage(),
  '/AppUserPages': (context) => AppUserPage(),
  '/attributePage': (context) => AttributePage(),
  '/testUpload': (context) => MyTestUpload(),
  '/giftPage': (context) => GiftPage(),
  '/reportyPage': (context) => ReportPage(),
  '/headerPortrait': (context) => HeaderPortraitPage(),
  '/activePage': (context) => ActivePage(),
  '/realName': (context) => RealNamePage(),
  '/brushTag': (context) => BrushHappyPage(),

};

var onGenerateRoute = (RouteSettings settings) {
  // 统一处理
  final String name = settings.name;
  final Function pageContentBuilder = routes[name];
  if (pageContentBuilder != null) {
    if (settings.arguments != null) {
      final Route route = MaterialPageRoute(
          builder: (context) =>
              pageContentBuilder(context, arguments: settings.arguments));
      return route;
    } else {
      final Route route =
          MaterialPageRoute(builder: (context) => pageContentBuilder(context));
      return route;
    }
  }
};
